namespace ImapComponent.Net.Mail.Imap4
{
    /// <summary>
    /// Represents the mailbox.
    /// </summary>
    public class Mailbox
    {
        #region Fields

        private string name;
        private string rawName;
        private string shortName;
        private string delimiter;
        private MailboxFlags flags;
        private int nestingLevel;

        #endregion // Fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the Mailbox class.
        /// </summary>
        private Mailbox(string name, string rawName, string shortName, string delimiter, MailboxFlags flags, int nestingLevel)
        {
            this.name = name;
            this.rawName = rawName;
            this.shortName = shortName;
            this.delimiter = delimiter;
            this.flags = flags;
            this.nestingLevel = nestingLevel;
        }

        /// <summary>
        /// Factory method.
        /// </summary>
        public static Mailbox CreateMailbox(string name, string rawName, string shortName, string delimiter, MailboxFlags flags, int nestingLevel)
        {
            return new Mailbox(name, rawName, shortName, delimiter, flags, nestingLevel);
        }

        #endregion // Constructors

        #region Properties

        /// <summary>
        /// Gets the full name of the mailbox.
        /// </summary>
        public string Name
        {
            get
            {
                return this.name;
            }
        }

        /// <summary>
        /// Gets the UTF7 encoded name of the mailbox.
        /// </summary>
        public string RawName
        {
            get
            {
                return this.rawName;
            }
        }

        /// <summary>
        /// Gets the short name of the mailbox.
        /// </summary>
        public string ShortName
        {
            get
            {
                return this.shortName;
            }
        }

        /// <summary>
        /// Gets the delimiter of the hierarchy.
        /// </summary>
        public string Delimiter
        {
            get
            {
                return this.delimiter;
            }
        }

        /// <summary>
        /// Gets mailbox flags.
        /// </summary>
        public MailboxFlags Flags
        {
            get
            {
                return this.flags;
            }
        }

        /// <summary>
        /// Gets the zero-based nesting level number.
        /// </summary>
        public int NestingLevel
        {
            get
            {
                return this.nestingLevel;
            }
        }

        #endregion // Properties
    }
}